import { createApp } from 'vue'
import App from './App.vue'
import router from './router/index'
import "@/style/globalStyles.scss"

import 'amfe-flexible'
// import Vant from 'vant'
// import 'vant/lib/index.css'

import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';


// if (import.meta.env.VITE_USER_NODE_ENV !== 'production') {
//   // 如果不是生产环境 就加载vconsole
//   import('vconsole').then(VConsole => {
//     new VConsole.default();
//   });
// }


import { onMounted } from 'vue';
import { getGlobalStyles } from './services/globalStyles';

onMounted(async () => {
    const globalStyles = await getGlobalStyles();
    if (globalStyles) {
        document.documentElement.style.setProperty('--global-font-size', `${globalStyles.fontSize}px`);
        document.documentElement.style.setProperty('--global-font-color', globalStyles.fontColor);
    }
});

const app = createApp(App)
app.use(router)
// app.use(Vant)
app.use(ElementPlus);

app.mount('#app')


